﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Text;

namespace DG.Common.EF
{
    public interface IDbContext: IDisposable
    {
        int SaveChanges();

        DbContext Context { get; }

        IDbSet Set(Type t);
        DbSet<T> Set<T>() where T : class;
    }

    public interface IDbSet : IQueryable
    {
        IQueryable Query();
        IEnumerable<object> Project();
        object Find(object[] keys);
        void Remove(object entity);
        void Add(object entity);
    }
}
